﻿#ifndef CHARTVIEW_H
#define CHARTVIEW_H

#include <QWidget>
#include <QMap>
#include <QTimer>

#include "Thread/chartthread.h"
#define TM	"TimePoint"

namespace Ui {
	class ChartView;
}

class ChartView : public QWidget
{
	Q_OBJECT

public:
    explicit ChartView(QWidget* parent = 0);
	~ChartView();

	enum Orientation
	{
		BARCHART_VIEW = 0,
		LINECHART_VIEW,
		SPLINE_VIEW,
	};
	void setTitle(QString name);

	void clear();
	void DataInit(QString file, Orientation type);



    int m_nView;
public slots:
	void sloInfo();

	void timerSlot();
private:
	Ui::ChartView* ui;
	QMap<QString, QMap<QString, long long>> scores;
	QString m_sTitle;
	ChartThread* pThread;
	QString m_sFile;

	bool m_bState;
	bool m_bRun;

	QString m_strName;

	QTimer* m_qTimer;
	int m_row1, m_row2, m_rowMax2;
};

#endif // CHARTVIEW_H
